package com.hzqy.persistence.dao.thirdhospitalbedno;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Repository;

import com.hzqy.persistence.dao.core.PersistenceDao;
import com.hzqy.web.vo.thirdhospitalbedno.ThirdHospitalBedNoVo;

@Repository
public class ThirdHospitalBedNoDao extends PersistenceDao<ThirdHospitalBedNoVo, Integer> {
	protected final Logger LOG = LoggerFactory.getLogger(getClass());
	
	/**
	 * 查询市三医院机顶盒账号与床位号绑定关系数量
	 * @param thirdHospitalBedNoVo
	 * @return
	 */
	public int selectThirdHospitalBedNoCount(ThirdHospitalBedNoVo thirdHospitalBedNoVo) {
		return getSqlSession().selectOne(this.getNamespace() + "selectThirdHospitalBedNoCount", thirdHospitalBedNoVo);
	}
	
	/**
	 * 查询市三医院机顶盒账号与床位号绑定关系集合
	 * @param map
	 * @return
	 */
	public List<ThirdHospitalBedNoVo> selectThirdHospitalBedNoList(Map<String, Object> map) {
		return getSqlSession().selectList(this.getNamespace() + "selectThirdHospitalBedNoList", map);
	}

	/**
	 * 新增市三医院机顶盒账号与床位号绑定关系
	 * @param map
	 * @return
	 */
	public int insertThirdHospitalBedNo(ThirdHospitalBedNoVo thirdHospitalBedNoVo) {
		return getSqlSession().insert(this.getNamespace() + "insertThirdHospitalBedNo", thirdHospitalBedNoVo);
	}
	
	/**
	 * 查询指定的市三医院机顶盒账号与床位号绑定关系
	 * @param f_bed_id
	 * @return
	 */
	public ThirdHospitalBedNoVo selectThirdHospitalBedNoById(int f_bed_id) {
		Map<String, Object> map = new HashMap<>();
		map.put("f_bed_id", f_bed_id);
		return getSqlSession().selectOne(this.getNamespace() + "selectThirdHospitalBedNoById", map);
	}

	/**
	 * 修改市三医院机顶盒账号与床位号绑定关系
	 * @param thirdHospitalBedNoVo
	 * @return
	 */
	public int updateThirdHospitalBedNoById(ThirdHospitalBedNoVo thirdHospitalBedNoVo) {
		return getSqlSession().update(this.getNamespace() + "updateThirdHospitalBedNoById", thirdHospitalBedNoVo);
	}
	
	/**
	 * 删除指定的市三医院机顶盒账号与床位号绑定关系
	 * @param f_bed_id
	 * @return
	 */
	public int deleteThirdHospitalBedNo(int f_bed_id) {
		Map<String, Object> map = new HashMap<>();
		map.put("f_bed_id", f_bed_id);
		return getSqlSession().delete(this.getNamespace() + "deleteThirdHospitalBedNo", map);
	}
	
}
